package org.log4jconfig.xml.editor.utils;

import junit.framework.Assert;

import org.junit.Test;

public class JdtUtilsTestCase {

	@Test
	public void testGetPackageFromQualifiedName() {
		Assert.assertEquals("org", JdtUtils.getPackageFromQualifiedName("org"));
		Assert.assertEquals("org", JdtUtils.getPackageFromQualifiedName("org."));
		Assert.assertEquals("org", JdtUtils.getPackageFromQualifiedName("org.A"));
		Assert.assertEquals("org.apache", JdtUtils.getPackageFromQualifiedName("org.apache"));
		Assert.assertEquals("org.apache", JdtUtils.getPackageFromQualifiedName("org.apache."));
		Assert.assertEquals("org.apache", JdtUtils.getPackageFromQualifiedName("org.apache.App"));
		Assert.assertEquals("", JdtUtils.getPackageFromQualifiedName(null));
		Assert.assertEquals("", JdtUtils.getPackageFromQualifiedName("Appender"));
		Assert.assertEquals("", JdtUtils.getPackageFromQualifiedName("."));
		Assert.assertEquals("", JdtUtils.getPackageFromQualifiedName(""));
		
		
	}

}
